package io.jpress.module.theme.controller;

import com.jfinal.plugin.activerecord.Page;
import io.jboot.web.controller.annotation.RequestMapping;
import io.jpress.core.menu.annotation.AdminMenu;
import io.jpress.module.theme.model.Template;
import io.jpress.module.theme.service.TemplateService;
import io.jpress.web.base.AdminControllerBase;

import javax.inject.Inject;


@RequestMapping("/admin/theme")
public class _ThemeController extends AdminControllerBase{

    @Inject
    TemplateService templateService;

    @AdminMenu(groupId = "theme",text = "主题列表",order = 1)
    public void index(){
        Page<Template> page = (Page<Template>) templateService.paginate(getPagePara(),10);
        setAttr("page",page);

        render("theme/theme_list.html");
    }
}
